VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "LProducto"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'---------------------------------------------------------------------------------------
' Module    : LProducto
' DateTime  : 30/11/2011 12:41
' Author    :
' Purpose   : Clase Logica Negocio Producto
'---------------------------------------------------------------------------------------
Option Explicit
Dim dao As DAOProducto
Dim logDAO As DAOLog
Private Const MODULO As String = "PRODUCTO"
Private Sub Class_Initialize()
Set dao = New DAOProducto
End Sub
Public Function getBean(ByVal bean As bproducto) As bproducto
  Set dao.Connection = utilConexion
  Set getBean = dao.getBean(bean)
End Function
Public Function getPagina(bean As bproducto, ByRef bpaginador As bpaginador, ByRef error As Integer) As Collection
Dim result As Collection
Set dao.Connection = utilConexion
Set result = dao.getPagina(bean, bpaginador)
If Not result Is Nothing Then
    Set getPagina = result
Else
    'capturarError UtilConstantes.STR_LISTAR
    error = UtilConstantes.OPT_ERROR_ENCONTRADO
End If
hnderr:
If Err.Number = 0 Then Exit Function
'capturarError UtilConstantes.STR_LISTAR
End Function
Public Function getLista(ByRef error As Integer) As Collection
Dim result As Collection
Dim bproducto As New bproducto
bproducto.bEstado.ncodigo = UtilConstantes.ESTADO_PRODUCTO_ACTIVO
Set dao.Connection = utilConexion
Set result = dao.getLista(bproducto)
If Not result Is Nothing Then
    Set getLista = result
Else
   ' capturarError UtilConstantes.STR_LISTAR
    error = UtilConstantes.OPT_ERROR_ENCONTRADO
End If
hnderr:
If Err.Number = 0 Then Exit Function
'capturarError UtilConstantes.STR_LISTAR
End Function
'Private Sub capturarError(opcion As String)
'Set bLog.busuario = bparametro.bUsuarioActivo
'bLog.sOpcion = opcion
'bLog.sModulo = MODULO
'If bConfiguracion.guardarHistorialSucesos Then
'    Set logDAO.Connection = utilConexion
'    logDAO.guardarNuevo bLog
'End If
'If bConfiguracion.enviarMailSuceso Then
'    'TO DO
'End If
'Set bLog = Nothing
'End Sub
'
